import Main from '@/components/main'
import parentView from '@/components/parent-view'

/**
 * meta中除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: '首页',
          notCache: true,
        },
        component: () => import('@/view/home/home')
      }
    ]
  },
  {
    path: '/index',
    name: 'index',
    meta: {
      title: '首页',
      icon:"md-home",
    },
    redirect: '/home',
  },
  /* 用户管理 */
  {
    path: '/userManagement',
    name: 'userManagement',
    meta: {
      title: '用户管理',
      icon:"ios-list",
    },
    component: Main,
    children: [
      {
        path: 'all',
        name: 'userManagementAll',
        meta: {
          title: '全部账号'
        },
        component: () => import('@/view/userManagement/all.vue')
      },
      {
        path: 'stair',
        name: 'userManagementStair',
        meta: {
          title: '一级账号'
        },
        component: () => import('@/view/userManagement/stair.vue')
      },
      {
        path: 'administration',
        name: 'userManagementAdministration',
        meta: {
          title: '系统管理员'
        },
        component: () => import('@/view/userManagement/administration.vue')
      },
    ]
  },
  /* 我的项目 */
  {
    path: '/myproject',
    name: 'myproject',
    meta: {
      title: '我的项目',
      icon:"ios-list",
    },
    component: Main,
    children: [
      {
        path: '/myproject/rojectProcedures',
        name: 'rojectProcedures',
        meta: {
          title: '项目流程'
        },
        component: () => import('@/view/myProjects/rojectProcedures.vue')
      },
      {
        path: '/myproject/underway',
        name: 'underway',
        meta: {
          title: '正在进行'
        },
        component: () => import('@/view/myProjects/underway.vue')
      },
      {
        path: '/myproject/projectQuery',
        name: 'projectQuery',
        meta: {
          title: '项目查询'
        },
        component: () => import('@/view/myProjects/projectQuery.vue')
      },
      {
        path: '/myproject/myReview',
        name: 'myReview',
        meta: {
          title: '我的审核'
        },
        component: () => import('@/view/myProjects/myReview.vue')
      },
      {
        path: '/myproject/allocationOfitems',
        name: 'allocationOfitems',
        meta: {
          title: '项目分配'
        },
        component: () => import('@/view/myProjects/allocationOfitems.vue')
      },
      {
        path: '/myproject/projectLibrary',
        name: 'projectLibrary',
        meta: {
          title: '项目库'
        },
        component: () => import('@/view/myProjects/projectLibrary.vue')
      },
    ]
  },
  /* 系统管理 */
  {
    path: '/systemManagement',
    name: 'systemManagement',
    meta: {
      title: '系统管理',
      icon: 'md-mail',
    },
    component: Main,
    children: [
      {
        path: '/systemManagement/menuManagement',
        name: 'menuManagement',
        meta: {
          title: '菜单管理'
        },
        component: () => import('@/view/systemManagement/menuManagement.vue')
      },
      {
        path: '/systemManagement/contents',
        name: 'contents',
        meta: {
          title: '帮助内容'
        },
        component: () => import('@/view/systemManagement/contents.vue')
      },
      {
        path: '/systemManagement/aboutUs',
        name: 'aboutUs',
        meta: {
          title: '关于我们'
        },
        component: () => import('@/view/systemManagement/aboutUs.vue')
      },
    ]
  },
  /* 数据库管理 */
  {
    path: '/databaseManagement',
    name: 'databaseManagement',
    meta: {
      title: '数据库管理',
      icon:"md-list",
    },
    component: Main,
    children: [
      {
        path: '/databaseManagement/databaseManagement',
        name: 'databaseManagement',
        meta: {
          title: '数据库管理'
        },
        component: () => import('@/view/databaseManagement/databaseManagement.vue')
      },
    ]
  },
  /* 统计分析 */
  {
    path: '/statisticAnalysis',
    name: 'statisticAnalysis',
    meta: {
      title: '统计分析',
      icon: 'md-mail',
    },
    component: Main,
    children: [
      {
        path: '/statisticAnalysis/stats',
        name: 'stats',
        meta: {
          title: '账户统计'
        },
        component: () => import('@/view/statisticAnalysis/stats.vue')
      },
      {
        path: '/statisticAnalysis/statisticalItem',
        name: 'statisticalItem',
        meta: {
          title: '项目统计'
        },
        component: () => import('@/view/statisticAnalysis/statisticalItem.vue')
      },
    ]
  },
  /* 反馈与支持 */
  {
    path: '/feedback',
    name: 'feedback',
    meta: {
      title: '反馈与支持',
      icon: 'md-mail',
    },
    component: Main,
    children: [
      {
        path: '/feedback/retroaction',
        name: 'retroaction',
        meta: {
          title: '反馈与支持'
        },
        component: () => import('@/view/feedback/retroaction.vue')
      },
    ]
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error/404.vue')
  }
]
